package com.yunke.common.result;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 云科统一状态码枚举
 * 
 * @author yunke
 * @since 1.0.0
 */
@Getter
@AllArgsConstructor
public enum YunkeResultCode {

    // ========== 通用状态码 ==========
    SUCCESS(200, "操作成功"),
    ERROR(500, "操作失败"),
    PARAM_ERROR(400, "参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    DATA_NOT_FOUND(404, "数据不存在"),
    METHOD_NOT_ALLOWED(405, "请求方法不允许"),
    TOO_MANY_REQUESTS(429, "请求过于频繁"),
    FAILURE(500, "操作失败"),
    INTERNAL_SERVER_ERROR(500, "系统内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),

    // ========== 用户相关状态码 (1001-1999) ==========
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_DISABLED(1002, "用户已被禁用"),
    USER_PASSWORD_ERROR(1003, "密码错误"),
    USER_ALREADY_EXIST(1004, "用户已存在"),
    USER_NOT_LOGIN(1005, "用户未登录"),
    USER_PHONE_EXIST(1006, "手机号已存在"),
    USER_EMAIL_EXIST(1007, "邮箱已存在"),
    USER_NICKNAME_EXIST(1008, "昵称已存在"),
    USER_OLD_PASSWORD_ERROR(1009, "原密码错误"),
    USER_REGISTER_FAIL(1010, "用户注册失败"),
    USER_AUTH_EXIST(1011, "用户已实名认证"),
    USER_AUTH_FAIL(1012, "实名认证失败"),

    // ========== Token相关状态码 (2001-2999) ==========
    TOKEN_INVALID(2001, "Token无效"),
    TOKEN_EXPIRED(2002, "Token已过期"),
    TOKEN_NOT_EXIST(2003, "Token不存在"),
    TOKEN_REFRESH_FAIL(2004, "Token刷新失败"),

    // ========== 验证码相关状态码 (3001-3999) ==========
    CAPTCHA_ERROR(3001, "验证码错误"),
    CAPTCHA_EXPIRED(3002, "验证码已过期"),
    SMS_CODE_ERROR(3003, "短信验证码错误"),
    SMS_CODE_EXPIRED(3004, "短信验证码已过期"),
    SMS_SEND_FAIL(3005, "短信发送失败"),
    EMAIL_CODE_ERROR(3006, "邮箱验证码错误"),
    EMAIL_SEND_FAIL(3007, "邮件发送失败"),

    // ========== 文件相关状态码 (4001-4999) ==========
    FILE_UPLOAD_FAIL(4001, "文件上传失败"),
    FILE_DELETE_FAIL(4002, "文件删除失败"),
    FILE_NOT_EXIST(4003, "文件不存在"),
    FILE_SIZE_EXCEED(4004, "文件大小超出限制"),
    FILE_TYPE_NOT_SUPPORT(4005, "不支持的文件类型"),

    // ========== 搭子相关状态码 (5001-5999) ==========
    DAZI_NOT_EXIST(5001, "搭子活动不存在"),
    DAZI_ALREADY_JOIN(5002, "已参与该搭子活动"),
    DAZI_JOIN_FAIL(5003, "参与搭子活动失败"),
    DAZI_MEMBER_FULL(5004, "搭子活动人数已满"),
    DAZI_EXPIRED(5005, "搭子活动已过期"),
    DAZI_CANCEL_FAIL(5006, "取消搭子活动失败"),
    DAZI_CREATE_FAIL(5007, "创建搭子活动失败"),
    DAZI_UPDATE_FAIL(5008, "更新搭子活动失败"),
    DAZI_DELETE_FAIL(5009, "删除搭子活动失败"),
    DAZI_STATUS_ERROR(5010, "搭子活动状态错误"),

    // ========== 订单相关状态码 (6001-6999) ==========
    ORDER_NOT_EXIST(6001, "订单不存在"),
    ORDER_STATUS_ERROR(6002, "订单状态错误"),
    ORDER_CREATE_FAIL(6003, "订单创建失败"),
    ORDER_PAY_FAIL(6004, "订单支付失败"),
    ORDER_CANCEL_FAIL(6005, "订单取消失败"),
    ORDER_REFUND_FAIL(6006, "订单退款失败"),

    // ========== 支付相关状态码 (7001-7999) ==========
    PAYMENT_NOT_EXIST(7001, "支付记录不存在"),
    PAYMENT_STATUS_ERROR(7002, "支付状态错误"),
    PAYMENT_AMOUNT_ERROR(7003, "支付金额错误"),
    PAYMENT_CONFIG_ERROR(7004, "支付配置错误"),
    WECHAT_PAY_ERROR(7005, "微信支付错误"),
    ALIPAY_ERROR(7006, "支付宝支付错误"),
    WECHAT_LOGIN_ERROR(7007, "微信登录错误"),

    // ========== 权限相关状态码 (8001-8999) ==========
    PERMISSION_DENIED(8001, "权限不足"),
    ROLE_NOT_EXIST(8002, "角色不存在"),
    MENU_NOT_EXIST(8003, "菜单不存在"),
    DEPT_NOT_EXIST(8004, "部门不存在"),

    // ========== 系统相关状态码 (9001-9999) ==========
    SYSTEM_ERROR(9001, "系统异常"),
    NETWORK_ERROR(9002, "网络异常"),
    DATABASE_ERROR(9003, "数据库异常"),
    REDIS_ERROR(9004, "Redis异常"),
    CONFIG_ERROR(9005, "配置错误"),
    THIRD_PARTY_ERROR(9006, "第三方服务异常"),

    // ========== 业务相关状态码 (10001-10999) ==========
    BUSINESS_ERROR(10001, "业务处理失败"),
    DATA_NOT_EXIST(10002, "数据不存在");

    /**
     * 状态码
     */
    private final Integer code;

    /**
     * 状态描述
     */
    private final String message;
} 